// pages/User/Mine/Mine.js
Page({
  data: {
    nickname: '',
    name: '',
    department: '',
    major: '',
    number: '',
    userAvatar: ''
  },

  onLoad: function() {
    // 从 storage 中读取用户信息
    const userInfo = wx.getStorageSync('userInfo');
    if (userInfo) {
      this.setData({
        nickname: userInfo.userName,
        name: userInfo.userName,
        department: userInfo.department,
        major: userInfo.userClass,
        number: userInfo.userNumber,
        userAvatar: userInfo.userAvatar
      });
    }
  },

  Alter: function() {
    wx.navigateTo({
      url: '/pages/User/Alter/Alter'
    });
  },
  Record: function() {
    wx.navigateTo({
      url: '/pages/User/Record/Record'
    });
  },
  CommentBox: function() {
    wx.navigateTo({
      url: '/pages/User/CommentBox/CommentBox'
    });
  },
  Aboutus: function() {
    wx.navigateTo({
      url: '/pages/User/Aboutus/Aboutus'
    });
  },
  ServiceCenter: function() {
    wx.navigateTo({
      url: '/pages/User/ServiceCenter/ServiceCenter'
    });
  },
  logout:function(){
    wx.navigateTo({
      url: '/pages/Login/Login',
    })
  }
});